namespace CodeConsult.Adafruit.BLE_UART
{
    internal static class Utils
    {
        public static void Swap(byte[] buffer, int index, int numberOfBytes)
        {
            while (numberOfBytes >= 2)
            {
                var backup = buffer[index];
                buffer[index] = buffer[index + numberOfBytes - 1];
                buffer[index + numberOfBytes - 1] = backup;

                index = index + 1;
                numberOfBytes = numberOfBytes - 2;
            }
        }

    }
}
